/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ifpb.pod.servidor;

import ifpb.pod.registro.Registro;
import ifpb.pod.remote.ServidorRemote;
import ifpb.pod.servidor.funcinalidades.ServidorRemoteImpl;
import java.net.MalformedURLException;
import java.rmi.AccessException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Diogenes
 */

public class StartServidor {
    public static void main(String[] args) {
        try {
//            Registry registro = LocateRegistry.createRegistry(10790);
//            Registro registro = new Registro();
//            Registro.createRegistro();
            ServidorRemote facada = new ServidorRemoteImpl();
            try {
                Registro.rebind("facadaServidor", facada);
            } catch (AccessException ex) {
                Logger.getLogger(StartServidor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (MalformedURLException ex) {
                Logger.getLogger(StartServidor.class.getName()).log(Level.SEVERE, null, ex);
            }
            System.out.println("Servidor pronto...");
        } catch (RemoteException ex) {
            ex.printStackTrace();
        }
        
    }

}
